<template>
请输入姓名：<input type="text" v-model.lazy="username" />
<div>姓名是：{{username}}</div>

请输入密码：<input type="text" v-model.trim="password" />
<div>密码是：{{password}}</div>


请输入第一个数字:<input type="text" v-model.number="num1"/></br>
请输入第一个数字:<input type="text" v-model.number="num2"/></br>
<!-- <div>和是:{{num1+num2}}</div> -->
 <button @click="add">计算和 </button>
 <div>{{result}}</div>
</template>

<script setup>
//潘伊杨 2430150126
import{ref} from "vue"
const username = ref("")
const password = ref("")
const num1 = ref("");
const num2 = ref("");
let result =ref (0);
function add (){
 result.value = Number(num1.value) + Number(num2.value);
  //result.value = num1.value + num2.value
}

</script>

<style>
</style>